package org.demo.algorithm.lagou.column.relearn;

/**
 * 求最大元素
 */
public class Max {

    public static Integer max(int[] source) {
        if (source == null || source.length == 0) {
            return null;
        }

        int max = Integer.MIN_VALUE;
        for (int value : source) {
            if (value > max) {
                max = value;
            }
        }
        return max;
    }

}
